package h_eekwan.basic;

public class J05_50Patterns {

	public static void main(String[] args) {
	

		
System.out.println("Pattern I");
	int i=1;
	int j=1;
	
	while(j<=6){						//행 row	
		while(i<=j){					//열 col
			System.out.print(i + " ");
			++i;
		}	
		++j;
		i = 1;
		
		System.out.println("");
	}
		
		
		System.out.println("Pattern II");
		
		 i = 1;
		 j = 6;
		
		while(j>=1){
			while(i<=j){
			System.out.print(i + " ");
			++i;
		}
			--j;
			i = 1;
			System.out.println(" ");
	}
/*		System.out.println("Pattern III");
		
		i = 1;
		j = 1;
		int k = 1;
		while(i<=6){
			while(j<=1){
				while(k<=6){
					System.out.print(" ");
					++k;	
					
				}
				System.out.println(j);
				++j;
				k=1;
			}	
			System.out.println(" ");
			++i;
			
			
			
		}*/
		
		
System.out.println("Pattern III");
	i = 6;
	j = 1;
	
		while(j<=6){
		while (i >= 1){
			if ( i > j )
				System.out.print( "  ");
			else				
				System.out.print(" "+i);
			--i;
			
		}System.out.println(" ");
		++j;
		i = 6;
	}
	
		
	System.out.println("Pattern IV");
	
	i = 1;
	j = 7;
	int k = 7;
	
	while(j>1){
		while(i<j){
			while(k>j){
				System.out.print("  ");
				--k;  
			}System.out.print(i + " ");
			 ++i;
					
		}System.out.println(" ");
		--j;
	i=1;
	k=7;
	}
	System.out.println("for문으로 작성한 Pattern IV");
	int a = 7;
	int b = 1;
	int c = 7;
	for(;a>1;--a){
		for(;b<a;++b){
			for(; c>a; --c){
				System.out.print("  ");
			}
				System.out.print(b + " ");
		}System.out.println(" ");
		b =1;
		c = 7;
	}
	
	for(int m = 1; m<=6;++m){
		for (int l = 1; l <=6; ++l){
		if( l >= m)
		System.out.print((l-(m-1)) + " ");
		else
		System.out.print("  ");
	 }System.out.println(" ");
	}	
/*	123456 6줄 생성
  		int i=1;
		int j=1;
		
		while(j<=6){			
			while(i<=6){
			System.out.print(i + " ");
			++i;
		}	
		++j;
		i = 1;
		System.out.println("");
	}*/
			
		
		
/*				int pat2 = 1;
				int pat1 = 1;
				
				while(pat1<=1){
					System.out.print(pat1+"		");
				while(pat2<=6){
					System.out.print(pat2+" ");
					++pat2;
					}
				++pat1;
				 pat2=1;
				 while(pat2<=1){
				 System.out.print("		"+pat2);
				 ++pat2;
				 }
				 System.out.print("	");				 
				 pat2=1;
				 while(pat2<=6){
					 System.out.println(" "+pat2);
					 ++pat2;
				 }
				}*/
	
				
				/*int one1 = 1;
				int one2 = 1;
				while(one1<6){
				while(one <6){
					System.out.print(one);
					System.out.print("		"+one);
					++one;
					System.out.print(" "+one);
					one++;
					System.out.print(" "+one);
					one++;
					System.out.print(" "+one);
					one++;
					System.out.print(" "+one);
					++one;
					System.out.print(" "+one);
					System.out.print(" 		"+one1);
					System.out.print("	"+one1);
					++one1;
					System.out.print(" "+one1);
					++one1;
					System.out.print(" "+one1);
					++one1;
					System.out.print(" "+one1);
					++one1;
					System.out.print(" "+one1);
					++one1;
					System.out.println(" "+one1);
				}
								
				System.out.print(one2);
				++one2;
				System.out.println(" "+one2);
				
				
				}	

	}*/
	
	}
}

